Skip to content

Conversation

@renatomarinho
Copy link
Collaborator

@renatomarinho renatomarinho commented Oct 24, 2025

Description

Describe your changes in detail.

Motivation and context

Why is this change required? What problem does it solve?

If it fixes an open issue, please link to the issue here (if you write fixes #num
or closes #num, the issue will be automatically closed when the pull is accepted.)

How has this been tested?

Please describe in detail how you tested your changes.

Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

Screenshots (if appropriate)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!

dependabot bot and others added 9 commits October 24, 2025 20:50
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
….0 || ^9.0 || ^10.0 to ^10.6.0

---
updated-dependencies:
- dependency-name: orchestra/testbench
  dependency-version: 10.6.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
…evelop/actions/cache-4

ci(deps): bump actions/cache from 3 to 4
…evelop/actions/checkout-5

ci(deps): bump actions/checkout from 4 to 5
…/orchestra/testbench-tw-10.6.0

chore(deps)(deps-dev): update orchestra/testbench requirement from ^8.0 || ^9.0 || ^10.0 to ^10.6.0
…evelop/actions/github-script-8

ci(deps): bump actions/github-script from 7 to 8
- Refactored to extract URLs only from HTML resource attributes
- No longer extracts URLs from JSON-LD structured data
- No longer extracts URLs from JavaScript code
- Added tests for JSON-LD and JavaScript edge cases
- Fixes #179 - DNS prefetch incorrectly parsing JSON schema
- All 45 tests passing with 199 assertions
Copilot AI review requested due to automatic review settings October 24, 2025 21:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Laravel PageSpeed middleware to handle edge cases in DNS prefetching and comment removal, while updating dependencies and CI workflows. The changes focus on fixing issues with large HTML documents and preventing DNS prefetch from extracting URLs from JavaScript/JSON-LD content.

Key changes:

  • Added error handling for PCRE operations to prevent blank pages on large HTML documents
  • Refactored DNS prefetch logic to only extract URLs from HTML attributes, not script content
  • Updated GitHub Actions workflows and test dependencies to newer versions

Reviewed Changes

Copilot reviewed 8 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Middleware/PageSpeed.php Added PCRE error checking to prevent returning null on regex failures with large content
src/Middleware/InsertDNSPrefetch.php Refactored URL extraction to target specific HTML attributes instead of generic URL pattern matching
tests/Middleware/LargeHtmlTest.php Added comprehensive tests for comment removal in large HTML documents
tests/Middleware/InsertDNSPrefetchTest.php Added tests verifying DNS prefetch ignores URLs in JSON-LD and JavaScript content
composer.json Updated orchestra/testbench to specific version ^10.6.0
.github/workflows/tests.yml Updated actions/checkout from v4 to v5
.github/workflows/pull-request.yml Updated actions/checkout, actions/cache, and actions/github-script to newer versions
.github/workflows/code-quality.yml Updated actions/checkout from v4 to v5

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

🔍 Pull Request Validation Results

  • Code Style: PSR-2 compliant
  • Tests: All passing
  • 📊 Coverage: 100.00%
  • 🚀 Ready to merge

Automated validation by GitHub Actions

@renatomarinho renatomarinho merged commit 7e5bf94 into master Oct 24, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants